package javolution;

import javolution.context.LogContext;
import javolution.lang.Configurable;
import javolution.testing.TestContext;
import javolution.testing.TimeContext;
import org.apache.http.cookie.ClientCookie;

/* loaded from: classes2.dex */
public class Javolution {
    public static final String VERSION = "5.2.3 (J2SE 1.5+) September 6 2007";

    protected Javolution() {
    }

    private static void builtInTests() {
        LogContext.info("Load Configurable Parameters from System.getProperties()...");
        Configurable.read(System.getProperties());
        LogContext.info("");
        Thread.currentThread().setPriority(10);
        new ContextTestSuite().run();
        new UtilTestSuite().run();
        TestContext.info("More tests coming soon...");
    }

    public static Class j2meGetClass(String str) {
        Class<?> cls;
        try {
            cls = Class.forName(str);
        } catch (ClassNotFoundException unused) {
            try {
                cls = Class.forName(str, true, Thread.currentThread().getContextClassLoader());
            } catch (ClassNotFoundException unused2) {
                try {
                    cls = Class.forName(str, true, ClassLoader.getSystemClassLoader());
                } catch (ClassNotFoundException unused3) {
                    cls = null;
                }
            }
        }
        if (cls != null) {
            return cls;
        }
        throw new JavolutionError("Class " + str + " not found");
    }

    public static CharSequence j2meToCharSeq(Object obj) {
        return (CharSequence) obj;
    }

    public static void main(String[] strArr) throws Exception {
        LogContext.enter(LogContext.SYSTEM_OUT);
        try {
            LogContext.info("Javolution - Java(TM) Solution for Real-Time and Embedded Systems");
            LogContext.info("Version 5.2.3 (J2SE 1.5+) September 6 2007 (http://javolution.org)");
            LogContext.info("");
            if (strArr.length > 0) {
                if (strArr[0].equals(ClientCookie.VERSION_ATTR)) {
                    return;
                }
                if (strArr[0].equals("test")) {
                    builtInTests();
                    return;
                } else if (strArr[0].equals("perf")) {
                    TimeContext.enter();
                    builtInTests();
                    TimeContext.exit();
                    return;
                }
            }
            LogContext.info("Usage: java -jar javolution.jar [arg]");
            LogContext.info("where arg is one of:");
            LogContext.info("    version (to show version information only)");
            LogContext.info("    test    (to perform self-tests)");
            LogContext.info("    perf    (to run benchmark)");
        } finally {
            LogContext.exit();
        }
    }
}
